<template>
	<view>
		<view class="flex flex-ai-c flex-jc-sb" style="background: #fff;padding: 32rpx;" v-for="(item,i) in list"
			:key="item.id" @click="skip((item))">
			<view v-if="swiperCurrent == 0">
				<view class="font-32">编号: {{item.unique_no}}</view>
				<view class="font-24 color-2" style="margin-top: 20rpx;">结算时间：{{item.createtime}}</view>
			</view>
			<view v-else>
				<view class="font-32">微信提现</view>
				<view class="font-24 color-2" style="margin: 20rpx 0;">申请时间：{{item.createtime}}</view>
				<view class="font-24 color-2">到账时间：{{item.oktime}}</view>
			</view>
			<view class="font-40 u-text-right" :class="[swiperCurrent == 0?'color-1':'color-3']">
				<view>{{swiperCurrent == 0?'+':'-'}}{{item.money}}</view>
				<view v-if="swiperCurrent==1" :style="{color: item.state==2?'#FF0000':'#999999'}" class="font-24">{{filterState(item.status)}}</view>
			</view>
		</view>
		<view v-if="!list.length" style="height: 50vh;" class="flex flex-jc-c flex-ai-c">
			<defaultImg />
		</view>
	</view>
</template>

<script setup lang="ts">
	import defaultImg from '@/components/default-img.vue'
	import {
		computed
	} from 'vue'
	interface Props {
		list ?: any[]
		swiperCurrent ?: string | number
	}
	const props = withDefaults(defineProps<Props>(), {
		list: () => [],
		swiperCurrent: 0,
	})
	const emit = defineEmits([])
	const filterState = computed(() => {
		return (state) => {
			let text = ''
			switch (state) {
				case 1:
					text = '提现成功'
					break
				case 2:
					text = '提现失败'
					break
				case 0:
					text = '待处理'
					break

			}
			return text
		}
	})
	const skip = (item) => {

	}
</script>

<style lang="scss" scoped>
	.font-40 {
		font-size: 40rpx;
	}

	.color-1 {
		color: #000000;
	}

	.color-2 {
		color: #999999;
	}

	.color-3 {
		color: #000000;
	}
</style>